package com.example.springdemo7.ServiceDemo;

import com.example.springdemo7.model.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Service
public class BeanConfig {

    @Bean
    public User user1() {
        User user = new User();
        user.setName("张三");
        user.setAge(18);
        return user;
    }

    @Bean
    public User user2() {
        User user = new User();
        user.setName("李四");
        user.setAge(20);
        return user;
    }
}
